<?php
	$red = $_GET[red];
	$green = $_GET[green];
	$blue = $_GET[blue];

	if($red=='' && $green=='' && $blue=='')
	{
		$red = 255;
		$green = 0;
		$blue = 0;
	}

	$step = 0.1;

	echo '<table border="0" cellspacing="0" cellpadding="0">';
		for($white=1; $white>0; $white-=$step)
		{
			$newRed = $red*(1-$white)+($white*255);
			$newGreen = $green*(1-$white)+($white*255);
			$newBlue = $blue*(1-$white)+($white*255);

			echo '<tr><td bgcolor="'.getColor2($newRed, $newGreen, $newBlue).'"><img src="./images/transparent.gif" width="20" height="10"/></td></tr>';
		}
		for($black=0; $black<1; $black+=$step)
		{
			$newRed = $red*(1-$black);
			$newGreen = $green*(1-$black);
			$newBlue = $blue*(1-$black);

			echo '<tr><td bgcolor="'.getColor2($newRed, $newGreen, $newBlue).'"><img src="./images/transparent.gif" width="20" height="10"/></td></tr>';
		}
	echo '</table>';

	function getColor2($red, $green, $blue)
	{
		$red = round($red, 0);
		$green = round($green, 0);
		$blue = round($blue, 0);

		$color = getHex2($red).getHex2($green).getHex2($blue);
		return $color;
	}

	function getHex2($int)
	{
		$char[0] = '0';
		$char[1] = '1';
		$char[2] = '2';
		$char[3] = '3';
		$char[4] = '4';
		$char[5] = '5';
		$char[6] = '6';
		$char[7] = '7';
		$char[8] = '8';
		$char[9] = '9';
		$char[10] = 'A';
		$char[11] = 'B';
		$char[12] = 'C';
		$char[13] = 'D';
		$char[14] = 'E';
		$char[15] = 'F';

		$left = 0;
		$right = 0;

		while((16*$left+$right) < $int)
		{
			$right++;
			if($right > 15)
			{
				$left++;
				$right = 0;
			}
		}

		return $char[$left].$char[$right];
	}

?>



